﻿@model RedSand.Site.Models.ProductInfo
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<div class="dialog" id="product-create" title="Thêm sản phẩm mới" style="width: 810px">
    @using (Ajax.BeginForm(new AjaxOptions {UpdateTargetId = "info-wrap", LoadingElementId = "loading-panel", OnFailure = "ajax_failure" }))
    {
        <div class="dialog-content">
            <div style="float: left; width: 630px">
                <div class="form-cell" style="width: 620px">
                    @Html.LabelFor(model => model.Name)
                    @Html.EditorFor(model => model.Name)
                </div>
                <div class="form-cell">
                    @Html.LabelFor(model => model.Type)
                    @Html.DropDownListFor(model => model.Type, DropDownListHelper.GetProductTypeList(true))
                </div>
                <div class="form-cell">
                    @Html.LabelFor(model => model.Status)
                    @Html.DropDownListFor(model => model.Status, DropDownListHelper.GetStatusList(false))
                </div>
                <div class="form-cell">
                    @Html.LabelFor(model => model.IsHot)
                    @Html.DropDownListFor(model => model.IsHot, DropDownListHelper.GetProductHotList(false))
                </div>
                <div class="form-cell" style="width: 620px">
                    @Html.LabelFor(model => model.Image)
                    <input type="text" id="choose-avatar" style="width: 496px" class="choose-file" name="NewImage" />
                </div>
            </div>
            <div style="float: left; width: 150px; margin-top: 15px">
                <img id="upload-image-preview" alt="" src="" width="150" />
            </div>
            <div class="form-cell" style="width: 100%;">
                @Html.LabelFor(model => model.Description)
                @Html.TextAreaFor(model => model.Description, new { style = "height:100px" })
            </div>
        </div>
        <div class="dialog-footer">
            <input type="submit" value="Tạo mới" />
            <input type="button" value="@Html.Translate("Cancel")" onclick="closeDialog('.dialog')" />
        </div>
    }
    <div id="out"></div>
</div>

